<?php
namespace Admin\Widget;
use Think\Controller;
class PtypeWidget extends Controller {
	public function getnamebypid($pid,$tid){
		
		if(empty($pid)){
			$type_name['tname']="顶级分类";
		}else{
			$type_name=M("Ptype")->where(array('tid'=>$pid))->find();
			
		}
		
		return $type_name['tname'];
	}
}